
cmake_minimum_required(VERSION 3.10.2)

# TODO 第一步 ： 导入头文件
include_directories("inc")

project("imitationqqsound")

# 批量导入所有源文件
file(GLOB allCPP *.c *.h *.cpp)

project("fomddemo")

add_library( # Sets the name of the library.
        native-lib

        # Sets the library as a shared library.
        SHARED

        # Provides a relative path to your source file(s).
        #             native-lib.cpp
        ${allCPP}
        )

# TODO 第二步 ： 导入库文件
# CMAKE_SOURCE_DIR == CMakeLists.txt所在的路径
# CMAKE_ANDROID_ARCH_ABI == 当前的CPU架构

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -L${CMAKE_SOURCE_DIR}/../jniLibs/${CMAKE_ANDROID_ARCH_ABI}")

find_library( # Sets the name of the path variable.
        log-lib

        # Specifies the name of the NDK library that
        # you want CMake to locate.
        log)

#  TODO 第三步 链接具体的库，到我们的libnative-lib.so总库

target_link_libraries( # Specifies the target library.
        native-lib

        # Links the target library to the log library
        # included in the NDK.
        ${log-lib}
        fmod
        fmodL
        )